-
Notifications
You must be signed in to change notification settings - Fork 114
Add a User-Agent when using the Lambda Runtime API #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? |
3 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that looks like a good idea to me. Left a small note :)
@swift-server-bot add to whitelist |
@swift-server-bot test this pease |
I assume you are maintaining some sort of version string for this package somewhere in the code. If so, it might be a good idea to incorporate the version string into the User Agent string. It would make it possible to track usage of the runtime across versions. |
Add a hard coded version number to the user agent string, for an eventual identification by the Lambda service ### Motivation: It's [an issue](#108) that was open more than 5 years ago and was never addressed. At the time, the consensus was to pickup a version number for the Package.swift file and the maintainer at the time decided to wait for Swift to implement this. Five years later, and several major version of Swift later, this is still not available. I decided to move on and implement a less optimal solution. This can be replaced in the future if package version ever becomes part of Package.swift. ### Modifications: Add a version enum to isolate the versioning in one place. I decided to keep it simple and not over engineering it with major, minor, patch and pre-release. At the time, it's a simple string. This is all what we need for usage in the user agent string. ### Result: User agent now identifies as `Swift-Lambda/2,0` instead of `Swift-Lambda/unknown`
Addresses #96 - This will help you stand out in a crowd of "Unknown/Unknown" in our logs